package com.logos.musicframe.converter;

import com.logos.musicframe.entity.Songs;
import com.logos.musicframe.entity.Users;
import com.logos.musicframe.req.UsersReq;
import com.logos.musicframe.resp.SongsResp;
import com.logos.musicframe.resp.UsersResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;


/**
 * @author logos
 * date 2025/5/29 17:57
 * @version v1.0
 * @Package com.logos.musicframe.converter
 */
@Mapper
public interface UsersConverter {

    UsersConverter INSTANCE = Mappers.getMapper(UsersConverter.class);

    /**
     * req 转换为 entity
     * @param usersReq
     * @return
     */
    @Mapping(target = "avatar", ignore = true)
    Users convertReqToEntity(UsersReq usersReq);

    /**
     *  entity 转换为 resp
     * @param users
     * @return
     */
    UsersResp convertEntityToResp(Users users);
}